import request from '@/utils/request'

// 获取企业列表
export function getEnterpriseList(params) {
  return request({
    url: '/park/enterprise',
    method: 'get',
    params
  })
}

// 获取行业数据
export function getIndustryList() {
  return request({
    url: '/park/industry',
    method: 'get'
  })
}

/**
 * 上传合同
 */
export function uploadAPI(data) {
  return request({
    url: '/upload',
    method: 'POST',
    data
  })
}

// 添加企业
export function addEnterprise(data) {
  return request({
    url: '/park/enterprise',
    method: 'post',
    data
  })
}

// 获取企业详情
export function getEnterpriseInfo(id) {
  return request({
    url: `/park/enterprise/${id}`,
    method: 'get'
  })
}

// 删除企业
export function deleteEnterprise(id) {
  return request({
    url: `/park/enterprise/${id}`,
    method: 'delete'
  })
}

// 修改企业
export function updateEnterprise(data) {
  return request({
    url: '/park/enterprise',
    method: 'put',
    data
  })
}

// 查询可租赁的楼宇
export function getBuildingList() {
  return request({
    url: '/park/rent/building',
    method: 'get'

  })
}

// 添加合同
export function addContract(data) {
  return request({
    url: '/park/enterprise/rent',
    method: 'post',
    data
  })
}

// 查询合同列表
export function getContractList(id) {
  return request({
    url: `/park/enterprise/rent/${id}`,
    method: 'get'
  })
}

// 删除合同
export function deleteContract(id) {
  return request({
    url: `/park/enterprise/rent/${id}`,
    method: 'delete'
  })
}

// 退租
export function returnContract(id) {
  return request({
    url: `/park/enterprise/rent/${id}`,
    method: 'put'
  })
}
